package cn.edu.scau.cmi.liuxintong.adapter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortUtilOfOject {
	public void sortStudent(ArrayList<Student> StudentList) {
	    Collections.sort(StudentList, new Comparator<Student>() {
	    	public int compare(Student s1,Student s2) {
	    		int idff=s1.getId()-s2.getId();
	    		if(idff>0) {
	    			return 1;
	    		}
	    		else if(idff<0) {
	    			return -1;
	    		}
	    		return 0;
	    	}
	    }); 
	}
		
}
